Hệ thống quản lý ISP trong PHP

1 <?php
2     require_once
'includes/header.php';
3     require_once
"includes/classes/admin-class.php";
4     $admins =
new Admins($dbh);
5     
if (!isset($_SESSION['admin_session']) )
6     {
7         $commons->redirectTo(SITE_PATH.
'login.php');
8     }
9 ?>
10     <div
class="dashboard">
11         <div
class="col-md-12 col-sm-12">
12         <div
class="col-md-6"><h4><a href="bills.php" class="btn btn-sm btn-primary"> Back</a> Paid bills for Month of November</h4></div>
13         <div
class="col-md-6">
14             <form
class="form-inline pull-right">
15               <div
class="form-group">
16                 <label
class="sr-only" for="search">Search for</label>
17                 <div
class="input-group">
18                   <div
class="input-group-addon"><span class="glyphicon glyphicon-search" aria-hidden="true"></span></div>
19                   <input type=
"text" class="form-control" id="search" placeholder="Type a name">
20                   <div
class="input-group-addon"></div>
21                 </div>
22               </div>
23             </form>
24             <!-- <a href=
"bill_generation.php" class="btn btn-success pull-right">Generate Again</a> -->
25         </div>
26         <br><br>
27         </div>
28         <div
class="col-md-12 col-sm-12" id="bill_table">
29             <table
class="table table-striped table-bordered">
30                 <thead
class="thead-inverse">
31                   <tr
class="info">
32                     <th>ID </th>
33                     <th>Name</th>
34                     <th>Package</th>
35                     <th>Months</th>
36                     <th>Amounts</th>
37                     <th>Reciept</th>
38                   </tr>
39                 </thead>
40               <tbody>
41               <?php
42               $customers = $admins->fetchActiveCustomers();
43               
if (isset($customers) && sizeof($customers) > 0){
44                 
foreach ($customers as $customer) {
45                             $customer_id = $customer->id;
46                             $customer_name = $customer->full_name;
47                             $package_id = $customer->package_id;
48                             $packageInfo = $admins->getPackageInfo($package_id);
49                             $amount = $packageInfo->fee;
50                             $package_name = $packageInfo->name;
51                             
52                             $bills = $admins->fetchPaymentSlip($customer_id);
53                             
if (isset($bills) && sizeof($bills) > 0 && !empty($bills)){
54                             ?>
55                             <tr>
56                                 <td><?=$customer_id?></td>
57                                 <td><?=$customer_name?></td>
58                                 <td><?=$package_name?></td>
59                                 <td><?=$bills->bill_month?></td>
60                                 <td><?=$bills->bill_amount?></td>
61                                 <td><button onclick=
"getReceipt(<?=$customer_id?>)" class="btn btn-primary">Receipt</button></td>
62                             </tr>
63                     <?php }
else{
64                         
//echo "No Bills yet paid !";
65                     }
66                     ?>
67               <?php
68                 }
69               } ?>
70               </tbody>
71             </table>
72         </div>
73     </div>
74
75     <?php include
'includes/footer.php'; ?>
76     <script>
77     function getReceipt(id) {
78         
let left = (screen.width/2)-(600/2);
79         
let top = (screen.height/2)-(800/2);
80         
let params = `scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no,width=600,height=800,left=${left},top=${top}`;
81         open(
'receipt.php?customer='+id, 'Payment Receipt !', params)
82         }
83     </script>


Gõ tìm kiếm nhanh...